//
//  OANoticeListVC.m
//  OA项目
//
//  Created by innofive on 2018/4/13.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "OANoticeListVC.h"

@interface OANoticeListVC ()

@end

@implementation OANoticeListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
   
    
}
-(void)onLoadViewByWillAppear:(UIView *)view
{
    WSELF(weakSelf);
   
    self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        [weakSelf onLoadDataForPageNum:weakSelf.startIndex];
    }];
    self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
        [weakSelf onLoadDataForPageNum:weakSelf.currentPageIndex];
    }];
    
}


-(void)onLoadDataForPageNum:(NSInteger)pageNum
{
    WSELF(weakSelf);
    [OANoticeListModel onPOSTParam:@{@"startPageNo":@(pageNum),
                                     @"numberOfOnePage":@"10",
                                     @"isOnlyNeedActiveNt":@"",
                                     @"searchKey":@"",
                                     } successBlock:^(id data) {
                                         if (pageNum==weakSelf.startIndex) {
                                             [weakSelf setupCellDataSuccessBlock:weakSelf.tableView](data);
                                         }
                                         else
                                         {
                                             [weakSelf addNewCellDataSuccessBlock:weakSelf.tableView](data);
                                         }
                                     } falieBlock:self.failedListBlock errorBlock:self.errorListBlock];
}


#pragma mark - 点击事件
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    OAWebVC *vc =[OAWebVC new];
    vc.url = @"http://wwww.baidu.com";
    [self pushToVC:vc];
}


#pragma mark - Table view data source


-(MCCellInfo *)tableView:(UITableView *)tableView cellForIndexPath:(NSIndexPath *)indexPath IsHeight:(BOOL)isheight
{
    return [MCCellInfo configForCellId:cell Class:[OAMainCell2 class] Height:kFitH(60) TableView:tableView CellStyle:(UITableViewCellStyleSubtitle)];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
